package com.etooling.pdm.entity;


import com.etooling.framework.svo.AbstractEntity;
import lombok.Data;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;
import java.util.List;

/**
 * 产品分类下的属性规范
 */
@Data
@Entity
@Table(name = "t_goods_type_properties", schema = "pdm")
public class GoodsTypeProperties extends AbstractEntity {
    final public static String PROPERTIES_TYPE_GOODS_SPECS = "物料";
    final public static String PROPERTIES_TYPE_INPUT = "自填";
    String propertiesName;//属性名
    String status;//状态
    String childInputType;//子项输入方式
    String companyId;//所属帐套
    Integer seq;//显示顺序
    GoodsType goodsType;
    String batchId; //excel导入的ID
    GoodsType bindGoodsType;
    String propertiesType; //自填,材质,物料
    String isSpecsProperties; //是否规格属性  是
    String specsPropertiesUnit; //规格单位
    String specsDisplayType; //规格显示方式:只描述规格;使用产品值
    String specsSeq;//规格显示顺序
    public GoodsTypeProperties(){
        super();
    }
    public GoodsTypeProperties(String propId) {
        super();
    }

    @ManyToOne(targetEntity = GoodsType.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "bind_goods_type_id")
    public GoodsType getBindGoodsType() {
        return bindGoodsType;
    }

    @ManyToOne(targetEntity = GoodsType.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "goods_type_id")
    public GoodsType getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(GoodsType goodsType) {
        this.goodsType = goodsType;
    }


}